package com.big.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.big.app.dao.FlowerDao;
import com.big.app.entity.Flower;
import com.big.app.service.intf.FlowerService;
import com.big.app.vo1.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FlowerServiceImpl implements FlowerService {
    @Autowired
    private FlowerDao dao;
    @Override
    public R add(Flower flower) {
        if (dao.insert(flower)>0){
            return R.ok();
        }else {
            return R.fail();
        }
    }

    @Override
    public R query() {
        QueryWrapper<Flower> queryWrapper=new QueryWrapper<>();
        return R.ok(dao.selectList(queryWrapper));
    }
}
